//
//  SWSeilal.h
//  SerialPort
//
//  Created by MT-SW-003 on 2021/4/9.
//  Copyright © 2021 MT-SW-003. All rights reserved.
//

#import "Serial.h"

NS_ASSUME_NONNULL_BEGIN

@interface SWSeilal : NSObject

/* get serial device fd */
- (int)serialDevice:(int)fd;

/*set baudRate, partiy, databit, stopbit*/
- (int)serialConfigForDevice:(int)fd
        withBaudRate:(int)baudRate
         withDataBit:(int)dataBit
         withStopBit:(int)stopBit
          withParity:(char)parity;

/* close device */
- (int)serialCloseDevice:(int)fd;

/* write data */
- (ssize_t)writeDataToDevice:(int)fd
                   writeBuff:(char *)sendData
             writeDataLength:(size_t)len;

/* read data */
- (NSMutableDictionary *)readDataFromDevice:(int)fd;

@end

NS_ASSUME_NONNULL_END
